'''
Authority - an attempt to port the best features of TG1's "identity"
    package to TG2

to use:
    app = YourWSGIApp()
    app = AuthoryMiddleware(app)
'''

#~ from webob import Request, Response
#~ from webob.exc import HTTPUnauthorized

#~ import logging
#~ log = logging.getLogger(__name__)

#~ class AuthorityMiddleware(object):
    #~ def __init__(self, app):
        #~ self.app = app
        
    #~ def __call__(self, environ, start_response):
        #~ req = Request(environ)
        #~ resp = req.get_response(self.app)
        #~ if resp.status == 401:
            #~ log.debug('Page is unauthorized')
            #~ #unauth = HTTPUnauthorized()
            #~ #return unauth(environ, start_response)
        #~ #else:
            
        #~ return resp(environ, start_response)
